package cn.iocoder.yudao.module.repair.dal.mysql.repair;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.repair.dal.dataobject.repair.RepairDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.repair.controller.admin.repair.vo.*;

/**
 * 报修记录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface RepairMapper extends BaseMapperX<RepairDO> {

    default PageResult<RepairDO> selectPage(RepairPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RepairDO>()
                .eqIfPresent(RepairDO::getBlock, reqVO.getBlock())
                .eqIfPresent(RepairDO::getLevel, reqVO.getLevel())
                .eqIfPresent(RepairDO::getRoom, reqVO.getRoom())
                .eqIfPresent(RepairDO::getRemark, reqVO.getRemark())
                .eqIfPresent(RepairDO::getContact, reqVO.getContact())
                .orderByDesc(RepairDO::getId));
    }

}